I'm having a problem using the scroll bars function on the canvases. I actually have no idea how to use it! |
Re: Using Scrollbars void hasScrollbars(DBE da, void cb(DBE canv, ScrollEvent Event, ScrollSide scrollBar, int newPos, int oldPos)) and implement it with the different callbacks and possible event types? |
Re: Using Scrollbars |
Re: Using Scrollbars rain_bow - Mon Jan 23 15:23:02 EST 2012 |
Re: Using Scrollbars phan423 - Mon Jan 23 18:04:35 EST 2012
Hi,
// Example program for using scrollbars with canvases
/*
The comment lines à la
// Comment 1) are w.r.t. to the Comments in the comment section
of the include file
*/
// Comment 1)
#include <../addins/include/canvas_scrollbar.inc>
// ----------------------------------------------------------------------
pragma runLim, 0
// ----------------------------------------------------------------------
// Comment 4)
void repaint(DBE dbe)
{ // Repaint routine for canvas
realBackground (dbe, realColor_White)
realColor(dbe,realColor_Green)
box(dbe, 100, 100, 300, 300)
realColor(dbe,realColor_Black)
rectangle(dbe, 0, 0, 10, 10)
rectangle(dbe, 590, 0, 10, 10)
rectangle(dbe, 0, 590, 10, 10)
rectangle(dbe, 590, 590, 10, 10)
} // Repaint routine for canvas
// ----------------------------------------------------------------------
void scrollBarExample()
{ // Example code for using scrollbars with canvases
DB exampleDB = create("Example for using scrollbars with canvases")
// Comment 5)
DBE cnvs = canvas(exampleDB, 200, 200, scrollCanvasRepaint)
// Comment 2)
hasScrollbars(cnvs, scrollCallBack)
// Comment 6
// The following three lines can be uncommented to force the size of the
// complete canvas; default is to calculate the complete size.
//totalDrawAreaHeight = 600
//totalDrawAreaWidth = 600
//autoCalcCanvasSize = false
// Comment 3)
realize exampleDB
scrollCallBack(cnvs, scrollToPos, horizontal, 0, 0)
scrollCallBack(cnvs, scrollToHome, vertical, 0, 0)
show exampleDB
} // Example code for using scrollbars with canvases
// ----------------------------------------------------------------------
scrollBarExample()
Attachments attachment_14781544_canvas_scrollbar.inc |
Re: Using Scrollbars Peter_Albert - Tue Jan 24 03:07:16 EST 2012
Hi,
// Example program for using scrollbars with canvases
/*
The comment lines à la
// Comment 1) are w.r.t. to the Comments in the comment section
of the include file
*/
// Comment 1)
#include <../addins/include/canvas_scrollbar.inc>
// ----------------------------------------------------------------------
pragma runLim, 0
// ----------------------------------------------------------------------
// Comment 4)
void repaint(DBE dbe)
{ // Repaint routine for canvas
realBackground (dbe, realColor_White)
realColor(dbe,realColor_Green)
box(dbe, 100, 100, 300, 300)
realColor(dbe,realColor_Black)
rectangle(dbe, 0, 0, 10, 10)
rectangle(dbe, 590, 0, 10, 10)
rectangle(dbe, 0, 590, 10, 10)
rectangle(dbe, 590, 590, 10, 10)
} // Repaint routine for canvas
// ----------------------------------------------------------------------
void scrollBarExample()
{ // Example code for using scrollbars with canvases
DB exampleDB = create("Example for using scrollbars with canvases")
// Comment 5)
DBE cnvs = canvas(exampleDB, 200, 200, scrollCanvasRepaint)
// Comment 2)
hasScrollbars(cnvs, scrollCallBack)
// Comment 6
// The following three lines can be uncommented to force the size of the
// complete canvas; default is to calculate the complete size.
//totalDrawAreaHeight = 600
//totalDrawAreaWidth = 600
//autoCalcCanvasSize = false
// Comment 3)
realize exampleDB
scrollCallBack(cnvs, scrollToPos, horizontal, 0, 0)
scrollCallBack(cnvs, scrollToHome, vertical, 0, 0)
show exampleDB
} // Example code for using scrollbars with canvases
// ----------------------------------------------------------------------
scrollBarExample()
this is what i have so far: DBE cnv = canvas(canvasBox, 1500, 700, doRepaint) void cb(DBE cnv,ScrollEvent Event,ScrollSide scrollBar,int newPos,int oldPos) { } hasScrollbars(cnv,cb) cb(cnv, scrollToPos, horizontal, 0, 0) cb(cnv, scrollToHome, vertical, 0, 0) |
Re: Using Scrollbars phan423 - Tue Jan 24 12:30:52 EST 2012 |
Re: Using Scrollbars phan423 - Thu Jan 26 11:57:18 EST 2012 Regards, Peter |